package com.example.demo;

import io.undertow.Handlers;
import io.undertow.Undertow;
import io.undertow.server.handlers.resource.PathResourceManager;
import java.io.File;

public class FileServer {

    public static void main(String[] args) {
        File file = new File("/");
        Undertow server = Undertow.builder().addHttpListener(8181, "localhost")
            .setHandler(Handlers.resource(new PathResourceManager(file.toPath(), 100)).setDirectoryListingEnabled(true))
            .build();
        server.start();
    }
}
